home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / pdcurs21.zip / PORTABLE.ZIP / RAW.C < prev    next >
Text File  |  1992-11-21  |  2KB  |  61 lines

  1. #define CURSES_LIBRARY 1
  2. #include <curses.h>
  3. #undef  raw
  4.  
  5. #ifndef NDEBUG
  6. char *rcsid_raw = "$Header: c:/curses/portable/RCS/raw.c%v 2.0 1992/11/15 03:29:25 MH Rel $";
  7. #endif
  8.  
  9.  
  10.  
  11.  
  12. /*man-start*********************************************************************
  13.  
  14.   raw()        - enable raw mode
  15.  
  16.   X/Open Description:
  17.         The terminal in placed into or out of raw mode.  Raw mode is
  18.         similar to cbreak mode, in that characters typed are immediately
  19.         passed through to the user program.  The differences are that in
  20.         raw mode, the INTR, QUIT, SUSP, and STOP characters are passed
  21.         through without being interpreted, and without generating a
  22.         signal.  The behaviour of the BREAK key depends on other
  23.         parameters of the terminal drive that are not set by curses.
  24.  
  25.   PDCurses Description:
  26.         Raw mode in the traditional sense refers to input handling.
  27.         Contrast raw_output() which enables 8bit characters.
  28.  
  29.         FYI:   PDCurses does NOT provide signal(3) support,
  30.                this must be done by the application.
  31.  
  32.   X/Open Return Value:
  33.         This function returns OK on success and ERR on error.
  34.  
  35.   X/Open Errors:
  36.         No errors are defined for this function.
  37.  
  38.   Portability:
  39.         PDCurses        int raw( void );
  40.         X/Open Dec '88  int raw( void );
  41.         BSD Curses      int raw( void );
  42.         SYS V Curses    int raw( void );
  43.  
  44. **man-end**********************************************************************/
  45.  
  46. int     raw(void)
  47. {
  48. #ifdef OS2
  49.        KBDINFO KbdInfo;
  50.  
  51.        KbdGetStatus(&KbdInfo,0);
  52.        KbdInfo.fsMask |= KEYBOARD_BINARY_MODE;
  53.        KbdInfo.fsMask &= ~KEYBOARD_ASCII_MODE;
  54.        KbdSetStatus(&KbdInfo,0);
  55. #endif
  56.        _cursvar.raw_inp = TRUE;
  57.        PDC_set_ctrl_break(FALSE);      /* disallow ^BREAK on disk I/O */
  58. /*     flushinp(); */
  59.        return( OK );
  60. }
  61.